<script>
	var qqmapsdk = require('./libs/qqmap-wx-jssdk.js');
	import {
		HTTP_REQUEST_URL,
		APPID
	} from './config/app';
	import {
		getconfig,
		history,
		getappid
	} from '@/api/public.js';
	export default {
		globalData: {
			_i18n: {},
			$t: {},
			mer_id: '',
			spid: 0,
			code: 0,
			isLogin: false,
			userInfo: {},
			MyMenus: [],
			balance_func_status: 0, //余额开关
			recharge_switch: 0, // 充值开关
			store_user_min_recharge: 0, //最小充值
			yue_pay_status: 0, //余额支付开关
			routine_logo: '', //首页logo
			site_logo: '',
			site_name: '', //名称
			fid: '', //一级分类id
			uid: '',
			order_id: '', //跳转支付反回来的订单号
			msg: '', //跳转支付反回来的结果
			city: '' //当前位置
		},
		onLaunch: function(option) {
			this.globalData._i18n = this.$i18n;
			this.globalData.$t = str => this.$t(str);
			//#ifdef H5
			that.globalData.mer_id = option.query.mer_id; //H5登录进来获得店铺id
			option.query.mer_id ? uni.setStorageSync('mer_id', option.query.mer_id) : that.globalData.mer_id = uni
				.getStorageSync('mer_id')
			//#endif
			//#ifdef MP
			if (option.id != undefined || option.id != "") {
				//根据appid获得商铺id
				this.globalData.mer_id = option.id;
			}
			//#endif
			//获得小程序配置
			getconfig()
				.then(res => {
					this.globalData.routine_logo = res.data.routine_logo;
				})
				.catch(err => {});
		},
		onShow: function(option) {
			if (!option.referrerInfo) {
				this.globalData.order_id = option.referrerInfo.extraData.order_id;
				this.globalData.msg = option.referrerInfo.extraData.msg;
			}
			if (option.scene == 1038 && option.path == 'pages/users/order_confirm/index') {
				uni.navigateTo({
					url: '/pages/order_pay_status/index?order_id=' + option.referrerInfo.extraData.order_id +
						'&msg=' + option.referrerInfo.extraData.msg
				});
			} else if (option.scene == 1038 && option.path == 'pages/users/order_list/index') {
				uni.navigateTo({
					url: 'pages/users/order_list/index'
				});
			}
		},
		methods: {}
	};
</script>

<style lang="scss">
	@import 'uview-ui/index.scss';
	@import 'static/css/base.css';
	@import 'static/iocnfont/iconfont.css';

	view {
		box-sizing: border-box !important;
	}
</style>
